# Author : ZZH
# Date : 2025/5/20
import os
os.environ['KMP_DUPLICATE_LIB_OK']='TRUE'

from ultralytics import YOLO

# Load a model
model = YOLO('yolov8n.yaml')  # 从YAML中构建一个新模型
model = YOLO('models/pretrained/yolov8n.pt')  # 加载预训练的模型(推荐用于训练)
model = YOLO('yolov8n.yaml').load('models/pretrained/yolov8n.pt')  # 从YAML构建并传递权重

# Train the model
model.train(data='./config/data.yaml', epochs=3, imgsz=640)
